﻿using SLUISystem;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;

public class TreeEditorWindow : EditorWindow
{
    public static EditorTree tree;
    [MenuItem("CustomTools/Demo/treeWindow")]
    static void OpenWindow()
    {
        TreeEditorWindow demoWindow = GetWindow(typeof(TreeEditorWindow)) as TreeEditorWindow;
        demoWindow.titleContent = new GUIContent("编辑器Demo");
        demoWindow.wantsMouseMove = true;
        demoWindow.minSize = new Vector2(600f, 500f);
        DontDestroyOnLoad(demoWindow);
    }

    private void OnEnable()
    {
        tree = new EditorTree(new TreeViewState(), 300);
    }

    private void OnGUI()
    {
        tree.OnGUI(EditorGUILayout.GetControlRect(false, 303));
    }
}